<script setup>
import {onMounted, reactive} from "vue";

let datasource = [
  {value: '1', text: 'aaa'},
  {value: '2', text: 'bbb'},
  {value: '3', text: 'ccc'},
  {value: '4', text: 'ddd'},
  {value: '5', text: 'eee'},
]

let props = defineProps({
  selectedObj: {
    type: Object,
    default: {}
  }
})

let emit = defineEmits(
    ['updateProps']
)

function aaa() {
  // console.log(props.selectedObj.value)
  let aa = datasource.filter(item => {
    return item.value === currentObj.value;
  })

  currentObj.text = aa[0].text;
  // console.log(currentObj)
}

let currentObj = reactive(props.selectedObj)
</script>

<template>
  <a-select style="width:200px" v-model:value="currentObj.value" @change="aaa">
    <a-select-option v-for="item in datasource" :value="item.value">{{ item.text }}</a-select-option>
  </a-select>
</template>

<style scoped>

</style>